/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package info.touret.winecellar.test;

import info.touret.winecellar.reminder.LocalCalendarServiceFactory;
import info.touret.winecellar.reminder.ReminderService;
import info.touret.winecellar.reminder.ReminderServiceImpl;
import info.touret.winecellar.userinfo.server.domain.UserInfo;

import com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig;
import com.google.appengine.tools.development.testing.LocalServiceTestHelper;
import com.google.gdata.client.calendar.CalendarService;
import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.Provides;
import com.google.inject.TypeLiteral;
import javax.validation.Validator;

/**
 * 
 * @author touret-a
 */
public class JunitModule implements Module {

	@Override
	public void configure(Binder binder) {
		binder.bind(ReminderService.class).to(ReminderServiceImpl.class);
		// binder.bind(EntityManager.class).toProvider(EMFactory.class);
		binder.bind(CalendarService.class).toProvider(
				LocalCalendarServiceFactory.class);
		binder.bind(Validator.class).toProvider(ValidatorProvider.class);

	}

	@Provides
	public UserInfo get() {
		LocalServiceTestHelper helper = new LocalServiceTestHelper(
				new LocalDatastoreServiceTestConfig());
		helper.setUp();
		UserInfo user = new UserInfo();
		user.setId(1L);
		user.setEmailAddress("test@mock.com");
		user.setGdatatoken("1245789");
		return user;
	}
}
